package main

import (
	"flag"
	"github.com/gin-gonic/gin"
	log "github.com/sirupsen/logrus"
	"strconv"
	"vpn/app/global"
	"vpn/config"
	"vpn/logger"
	"vpn/routers"
)

func main() {
	config.LoadYaml(true)
	global.Init()
	logger.Init(global.LogConf)
	log.Info("service started...")
	router := routers.InitApiRouter(gin.DebugMode)
	port := flag.Int("p", global.Conf.DefaultPort, "Port to run the server on")
	flag.Parse()
	_ = router.Run(":" + strconv.Itoa(*port))
}
